<?php
require_once 'pages/TMSFrontCategoryPage.inc';

class TMSFrontHomePage extends TMSFrontCategoryPage {
	public $Category;
	
	protected $_bool_shuffle_;
	
	
	public function Handle(THttpRequest $request){
		$request->id = $this->service->CatalogRoot;
		if ($this->Category)
			$request->id = $this->Category;

		if ($request->id)
			parent::Handle($request);
		else
			TMSFrontListPage::Handle($request);
	}
	
	protected function getSorting(){
		if ($this->_bool_shuffle_)
			return array(new TSortingOption('',TSortingType::SORT_SHUFFLE));
		return parent::getSorting();
	}
		
	public function Path(){
		return array();
	}
	
	public function Title(){
		return TMSFrontPage::Title();
	}	
}